-
-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: union_categorical supports identical categories with ordered #13763
Conversation
Current coverage is 85.33% (diff: 100%)@@ master #13763 diff @@
==========================================
Files 141 141
Lines 50703 50717 +14
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 43267 43281 +14
Misses 7436 7436
Partials 0 0
|
ead9cbb
to
7540677
Compare
and will raise if any are ordered. | ||
`union_categoricals` only works with: | ||
- unordered categoricals | ||
- ordered categoricals which has the same categories |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
has -> have
Looks good to me, other than a couple nit-picky doc things. |
7540677
to
0971621
Compare
In my thinking |
`union_categoricals` only works with unordered categoricals | ||
and will raise if any are ordered. | ||
`union_categoricals` only works with: | ||
- unordered categoricals |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO this should read:
In addition to the "easy" case of combining two categoricals of the same categories and order information (e.g. what you could also
append
for),union_categoricals
only works with unordered categoricals and will raise if any are ordered.
I.e. make it clear that union_categoricals supports something more than append.
0971621
to
9cadc4e
Compare
@chris-b1 , @JanSchulz any final comments? |
No, looks good to me. On Jul 28, 2016 7:32 PM, "Jeff Reback" [email protected] wrote:
|
LGTM |
ty sir! |
- needed for #13406, follow-up to #13763 Author: Chris <[email protected]> Author: sinhrks <[email protected]> Closes #13846 from chris-b1/union_categoricals_ordered and squashes the following commits: 3a710f0 [Chris] lint fix ff0bb5e [Chris] add follow-up PRs to whatsnew ecb2ae9 [Chris] more tests; handle sorth with ordered eea1777 [Chris] skip r-esort when possible on fastpath c559662 [sinhrks] ENH: add sort_categories argument to union_categoricals
git diff upstream/master | flake8 --diff
.append / concat
can handle orderedCategorical
which has the identical categories. However,union_categorical
raisesTypeError
. This PR allowsunion_categorical
to handle the case.on current mastser
CC: @JanSchulz, @chris-b1